import { Tools } from 'weaver-mobile';

const getLabel = Tools.getLabel; 

export const permissionType = {
  ANY_USER: 'ANY_USER',
  OA_USER: 'OA_USER',
  SPECIFIED_USER: 'SPECIFIED_USER'
};

export const defaultImg = '/messager/images/icon_m_wev8.jpg';

const { ANY_USER, OA_USER, SPECIFIED_USER } = permissionType;

export const personOpt = () => [
  {
    text: getLabel(523270, '可填写'),
    value: 'write'
  },
  {
    text: getLabel(523271, '删除'),
    value: 'delete'
  }
];

export const groupOpt = () => [
  {
    text: getLabel(523272, '设置群组内不参与填写的人员'),
    value: 'groupNoWrite'
  },
  {
    text: getLabel(523271, '删除'),
    value: 'delete'
  }
]

export const userType = {
  USER: 'USER',
  CHATGROUP: 'CHATGROUP',
  DEPARTMENT: 'DEPARTMENT',
  SUBCOMPANY: 'SUBCOMPANY'
};
export const getPermissionDatas = () => [
  {
    label: getLabel(523273, '所有人'),
    text: getLabel(523274, '外部用户和OA用户都可填写表单'),
    value: ANY_USER
  },
  {
    label: getLabel(523275, '所有OA用户'),
    text: getLabel(523276, '所有的OA用户可填写表单'),
    value: OA_USER

  },
  {
    label: getLabel(523277, '指定OA用户'),
    text: getLabel(523278, '仅指定的OA用户可填写表单'),
    value: SPECIFIED_USER
  }
];
